home *** CD-ROM | disk | FTP | other *** search
/ Internet.Works 41 / Issue 41.iso / pc / PCSoftware / MDaemon Server / mdsetupa.exe / GLOBALS.JS < prev    next >
Encoding:
Text File  |  2000-09-07  |  2.5 KB  |  121 lines

  1. var isNav, isIE;
  2. var coll = "";
  3. var styleObj = "";
  4. if (parseInt(navigator.appVersion) >= 4) {
  5.     if (navigator.appName == "Netscape") {
  6.         isNav = true;
  7.     } else {
  8.         isIE = true;
  9.         coll = "all.";
  10.         styleObj = ".style";
  11.     }
  12. }
  13.  
  14. function Mesg(Msg)
  15. {
  16.     if (Msg.length > 0)
  17.         alert(Msg);
  18. }
  19.  
  20. function Post(field, value)
  21. {
  22.     document.forms[0].action += '&' + field + '=';
  23.     if (value != null)
  24.         document.forms[0].action += value;
  25.     else
  26.         document.forms[0].action += 'Yes';
  27.  
  28.     if (typeof(Validate) == 'undefined' || Validate())
  29.         document.forms[0].submit();
  30. }
  31.  
  32. function Get(field, value)
  33. {
  34.     var url = document.forms[0].action += '&' + field + '=';
  35.     if (value != null)
  36.         url += value;
  37.     else
  38.         url += 'Yes';
  39.     document.location = url;
  40. }
  41.  
  42. function SetOption(name, value)
  43. {
  44.     for (var i=0; i<document.forms[0].length; i++)
  45.     {
  46.         if (document.forms[0].elements[i].name == name)
  47.             var element = document.forms[0].elements[i];
  48.     }
  49.     if (element == null)
  50.         return;
  51.  
  52.     if (element.type == 'checkbox')
  53.     {
  54.         if (element.value == value)
  55.             element.checked = true;
  56.     }
  57.     else if (element.type == 'radio')
  58.     {
  59.         for (var i=0; i<document.forms[0].length; i++)
  60.         {
  61.             if (document.forms[0].elements[i].name == name &&
  62.                 document.forms[0].elements[i].value == value)
  63.                 document.forms[0].elements[i].checked = true;
  64.         }
  65.     }
  66.     else if (element.type == 'select-one')
  67.     {
  68.         for (var i=0; i<element.length; i++)
  69.         {
  70.             if (element.options[i].value == value)
  71.                 element.selectedIndex = i;
  72.         }
  73.     }
  74.     else if (element.type == 'text')
  75.     {
  76.         element.value = value;
  77.     }
  78. }
  79.  
  80. /* List View Functions */
  81. function Sort(SortKey)
  82. {
  83.     var F=document.forms[0];
  84.     if (F.Sort.value.indexOf(SortKey) == -1)
  85.         F.Sort.value = SortKey;
  86.     else
  87.     {
  88.         if (F.Sort.value.indexOf('Rev') == -1)
  89.             F.Sort.value = 'Rev' + SortKey;
  90.         else
  91.             F.Sort.value = SortKey;
  92.     }
  93.     F.submit(); 
  94. }
  95.  
  96. function SelectAll() {
  97.     for (var i=0;i<document.forms[0].elements.length;i++) {
  98.         var e=document.forms[0].elements[i];
  99.         e.checked=!e.checked;
  100.     }
  101. }
  102.  
  103. function ChangeFolder() {
  104.     var F=document.forms[0];
  105.     F.DestFolder.selectedIndex=F.BottomFolder.selectedIndex;
  106. }
  107.  
  108. function ChangeBottomFolder() {
  109.     var F=document.forms[0];
  110.     F.BottomFolder.selectedIndex=F.DestFolder.selectedIndex;
  111. }
  112.  
  113. /* Message View Functions */
  114. function Print(url) {
  115.     window.open(url,'Print','height=400,width=600,scrollbars=yes,status=yes,resizable=1,toolbar=yes,menubar=yes');
  116. }
  117.  
  118. function Source(url) {
  119.     window.open(url,'Source','height=400,width=600,scrollbars=yes,status=yes,resizable=1');
  120. }
  121.